Repository navigation
P21: REPL doesn't echo None (as CPython); no «Visualisieren» for help/dir - #37
Merged
Merged
Conversation
CPython's interactive REPL never displays a None result (sys.displayhook
skips it): help(f), a call of a function without return and print(...)
show only what they print. glpython showed a trailing greyed-out None.
_glpython_repl now reports no value for None (the visualizer's trace of a
REPL input likewise, so the replay check still compares like with like).
A call of the builtin help or dir only prints documentation or names, so
its entry has no «Visualisieren» ("untraced"); a function of the
learner's called help still has one.
check-runtime-repl.py compares the REPL with `python3 -i` on the same file,
input by input: help(f), a function without return, print(1), None, a
value, an assignment, a list containing None.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fidelity fix P21, needed before Etappe 3.
1. No echo for
NoneCPython's interactive REPL never displays a result that is
None(sys.displayhookskips it).help(f), a call of a function withoutreturnandprint(…)show only what they print. glpython added a greyed-outNoneline, e.g. after>>> help(zeugnis_note)._glpython_replnow reports no value forNone, like a statement. This applies to the embed and the IDE alike; the greyedNonestyle is gone.None. Otherwise the replay check (2c) would compare a value against no value. Visualizingmelde('hallo')still works (checked in the embed).Noneas shown on purpose.2. No «Visualisieren» for
help(…)/dir(…)A single call of the builtin
helpordironly prints documentation or names, so there's nothing to step through. Its entry gets no button (untraced). A function of the learner's that is calledhelpkeeps its button.print(1 + 2)keeps its button too, since1 + 2can be stepped through.Test against CPython
scripts/check-runtime-repl.py(intest:runtime) runspython3 -ion the same file and compares, input by input, what it writes to stdout with what glpython's REPL shows. The inputs:help(zeugnis_note),melde('hallo')(noreturn),print(1),None,zeugnis_note(18, 24), an assignment,x,[None, melde(…)]andprint. It also checks thehelp/dirflag, including the learner's ownhelp. Againstmainit fails in 6 places: the extraNoneafterhelp,melde,printandNone, and the missing flag.Checked in the built embed (Pyodide):
help(zeugnis_note)shows only its documentation and has no «Visualisieren»;melde('hallo'),print(1)andNoneshow noNoneline;zeugnis_note(18, 24)→4.8.Lint (known warning only), both builds,
test:protocolandtest:runtime(10 scripts) pass. After the merge I tag v0.1.16 and bump the IDE.🤖 Generated with Claude Code